<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8" %>
<%@taglib prefix="s" uri="http://www.springframework.org/tags" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <meta name="description" content=""/>
    <meta name="keywords" content=""/>
    <title>报关一线通平台</title>
    <jsp:include page="../head.jsp"/>
    <%--<link rel="stylesheet" type="text/css"
          href="<s:url value="/views/yxtPc/assets/plugin/bootstrap/dist/css/bootstrap.css"/>"
          media="screen"/>--%>
    <link rel="stylesheet" type="text/css"
          href="<s:url value="http://static.bgext.com/css/jquery/jquery-ui-1.8.23.custom.min.css"/>"
          media="screen"/>

    <link rel="stylesheet"
          href="<s:url value="http://static.bgext.com/css/ztree/zTreeStyle.css"/>"
          type="text/css"/>
    <link href="<s:url value="http://static.bgext.com/css/index.css"/>" rel="stylesheet"
          type="text/css"/>
    <link href="<s:url value="http://static.bgext.com/css/tab/TabPanel.css"/>"
          rel="stylesheet" type="text/css"/>
    <link href="<s:url value="http://static.bgext.com/css/qq.css"/>" type="text/css"
          rel="stylesheet"/>
    <link href="<s:url value="http://static.bgext.com/css/ad.css"/>" type="text/css"
          rel="stylesheet"/>
    <link href="<s:url value="/css/overrideIndex.css"/>" type="text/css" rel="stylesheet"/>
    <link rel="stylesheet" type="text/css"
          href="<s:url value="/views/yxtPc/assets/plugin/photoScroll/css/photoScroll.css"/>"
          media="screen"/>
    <script type="text/javascript"
            src="<s:url value="http://static.bgext.com/js/jquery/jquery-1.8.0.min.js"/>"></script>
    <script type="text/javascript"
            src="<s:url value="http://static.bgext.com/js/jquery/jquery-ui-1.8.23.custom.min.js"/>"></script>
    <script src="<s:url value="http://static.bgext.com/js/ServiceQQ.js"/>"></script>
    <script type="text/javascript"
            src="<s:url value="http://static.bgext.com/js/jquery/jquery-1.8.0.min.js"/>"></script>
    <script type="text/javascript"
            src="<s:url value="http://static.bgext.com/js/ztree/jquery.ztree.all-3.4.min.js"/>"></script>
    <script type="text/javascript"
            src="<s:url value="http://static.bgext.com/js/tab/Fader.js"/>"></script>
    <script type="text/javascript"
            src="<s:url value="http://static.bgext.com/js/tab/TabPanel.js"/>"></script>
    <script type="text/javascript"
            src="<s:url value="http://static.bgext.com/js/tab/Math.uuid.js"/>"></script>
    <script type="text/javascript"
            src="<s:url value="http://static.bgext.com/js/rightClick/jquery.contextmenu.r2.js"/>"></script>
    <script type="text/javascript" src="<s:url value="/js/index.js"/>"></script>
    <style type="text/css">
        .photoGallery {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            z-index: 2;
        }
    </style>
    <!-- <script type="text/javascript" src="js/rightClick/tabClick.js"></script> -->

    <%--<style type="text/css">
        .ztree .level0 > ul {
            height: 420px;
        }

        .ztree li ul.line {
            background-image: none;
        }

        #winpop {
            width: 200px;
            height: 0px;
            position: absolute;
            right: 0;
            bottom: 0;
            border: 1px solid #666;
            margin: 0;
            padding: 1px;
            overflow: hidden;
            display: none;
        }

        #winpop .title {
            width: 100%;
            height: 22px;
            line-height: 20px;
            background: #FFCC00;
            font-weight: bold;
            text-align: center;
            font-size: 12px;
        }

        #winpop .con {
            width: 100%;
            height: 90px;
            line-height: 80px;
            font-weight: bold;
            font-size: 12px;
            color: #0033FF;
            text-decoration: underline;
            text-align: center
        }

        #silu {
            font-size: 12px;
            color: #666;
            position: absolute;
            right: 0;
            text-align: left;
            text-decoration: underline;
            line-height: 22px;
        }

        .close {
            position: absolute;
            right: 4px;
            top: -1px;
            color: #FFF;
            cursor: pointer
        }
    </style>--%>
    <script type="text/javascript">
        // window.onload = function() {//加载
        //悬浮框
        // var b = new scrollBanner(10, 15);
        // b.add(document.getElementById("rwc_hongbao"), 60, 10, 1, document.getElementById("rwc_c_hongbao"),"fixed");
        // b = null;
        //悬浮框
        // }
        // function refresh() {
        // $.ajax({
        // url : "index-refresh",
        // dataType : "json",
        // success : function(data) {
        // if($.parseJSON(data.msg).state == 0) {
        // // tips_pop();
        // // $("#message").text($.parseJSON(data.msg).msg);
        // var count = $.parseJSON(data.msg).msg;
        // $.ajax({
        // url : "index-companyType",
        // dateType : "json",
        // success : function(data) {
        // if($.parseJSON(data.msg).type == "CC") {
        // $("#message").text(count);
        // tips_pop();
        // }
        // }
        // });
        // }
        // }
        // });
        // }

        // window.onload = function() {//加载
        // document.getElementById('winpop').style.height = '0px';
        // // setInterval("tips_pop()", 3000);
        // setInterval("refresh()",10000);

        // }
        // function tips_pop() {
        // var MsgPop = document.getElementById("winpop");
        // var popH = parseInt(MsgPop.style.height);//将对象的高度转化为数字
        // if (popH == 0) {
        // MsgPop.style.display = "block";//显示隐藏的窗口
        // show = setInterval("changeH('up')", 2);
        // } else {
        // hide = setInterval("changeH('down')", 2);
        // }
        // }
        // function changeH(str) {
        // var MsgPop = document.getElementById("winpop");
        // var popH = parseInt(MsgPop.style.height);
        // if (str == "up") {
        // if (popH <= 100) {
        // MsgPop.style.height = (popH + 4).toString() + "px";
        // } else {
        // clearInterval(show);
        // }
        // }
        // if (str == "down") {
        // if (popH >= 4) {
        // MsgPop.style.height = (popH - 4).toString() + "px";
        // } else {
        // clearInterval(hide);
        // MsgPop.style.display = "none"; //隐藏DIV
        // }
        // }
        // }

        // function linkTo() {
        // tabObj.addTab({
        // id : "pendingAuditList",
        // title : "已提交待审核",
        // html : "<iframe id='orderFrame' src='business/declaration-listForSupToValidate?declaraState=DS01' width='100%' height='100%'frameborder='0'></iframe>",
        // closable : true,
        // disabled : false
        // });
        // }

        $(function () {
            $.ajax({
                       url: "index-remindDeclarationDue",
                       dataType: "json",
                       success: function (data) {
                           if (!data) {
                               return;
                           }
                           var msg = data.msg ? $.parseJSON(data.msg) : "";
                           if (msg !== undefined && msg != "" && msg.state == 0) {
                               var days = $.parseJSON(data.msg).days;
                               // window.open("http://localhost:8081/gtimp/dueRemind.jsp?days="+days, "_blank",
                               window.open("http://112.124.20.178:9180/gtimp/dueRemind.jsp?days="
                                           + days, "_blank",
                                           "height=310,width=610, left=400, top=300");
                               // window.open("http://219.130.222.62:9780/gtimp/dueRemind.jsp", "_blank",
                               // "height=200,width=400, left=400, top=300");
                           }
                       }
                   });
            /**
             * 手机绑定验证
             */
            if (!"${sessionScope.phoneNOBindingFirstOpen}") {
                $.ajax({
                           url: "/user/checkPhoneNOBinding",
                           dataType: "json",
                           cache: false,
                           success: function (data) {
                               if (!data.result) {
                                   layer.open({
                                                  title: false,
                                                  type: 2,
                                                  content: "/user/phoneNOBinding",
                                                  area: ['500px', '400px'],
                                              });
                               }
                           }
                       });
            }
        });

        function refresh() {

        }

        /**
         * 打开未付款页面，并且刷新未付款页面，假如当前标签不是未付款标签，则关闭它
         */
        function openUnpaidMainAndCurrentActiveTab() {
            var v3_0tabId = "4028803e58f1eded0158f1ee2203000e";
            var frameUnpaidMain = $("iframe#" + v3_0tabId + "Frame");
            var activePosision = tabObj.getActiveIndex();
            tabObj.tabs[activePosision].closer.click();
            var addUnpaidMainTab = function () {
                tabObj.addTab({
                                  id: v3_0tabId,
                                  title: "未付款",
                                  html: "<iframe id='" + v3_0tabId + "Frame' src='"
                                        + "business/unpaidMain"
                                        + "' width='100%' height='100%' frameborder='0'></iframe>",
                                  closable: true,
                                  disabled: false
                              });
            };
            if (frameUnpaidMain.length == 0) {
                try {
                    tabObj.getTitle(v3_0tabId);
                    $("iframe#" + v3_0tabId)[0].contentWindow.location.reload();
                    tabObj.show(v3_0tabId, null);
                } catch (e) {
                    addUnpaidMainTab();
                }
            } else {
                var tabPosision = tabObj.getTabPosision(v3_0tabId);
                addUnpaidMainTab();
            }
        }

        var readIds = Cookies("readIds");
        var readIdsKey = "readIds";
        if (readIds == undefined) {
            readIds = "";
            Cookies(readIdsKey, readIds);
        }
        function getNotification() {
            $.ajax({
                       url: '<s:url value="/notification/getNotifications"/>',
                       method: 'post',
                       data: {readIds: Cookies(readIdsKey)},
                       dataType: 'json',
                       success: function (result) {
                           if (result.result) {
                               var notifications = result.data;
                               $.each(notifications, function (i, n) {
                                   layer.open({
                                                  type: 1,   //0-4的选择,（1代表page层）
                                                  area: ['400px', '180px'],
                                                  shade: [0],  //不显示遮罩
                                                  offset: [document.body.clientHeight - 200,
                                                           document.body.clientWidth - 420],
                                                  border: [0], //不显示边框
                                                  title: [
                                                      n.title,
                                                      //自定义标题风格，如果不需要，直接title: '标题' 即可
                                                      'border:none; background:#0661A8; color:#fff;'
                                                  ],
                                                  bgcolor: '#eee', //设置层背景色
                                                  content: n.content,
                                                  shift: 'right-bottom' //从上动画弹出
                                              });
                                   var newReadIds = Cookies(readIdsKey);
                                   if (newReadIds == "") {
                                       newReadIds += n.id;
                                   } else {
                                       newReadIds += ("," + n.id);
                                   }
                                   Cookies(readIdsKey, newReadIds);
                               });
                           }
                       }
                   });
        }
        /**
         * 获取通知
         */
        function notification() {
            try {
                return setInterval(function () {
                    getNotification();
                }, 1000 * 1790);
            } catch (e) {
                console.log('get notification error!');
            }
        }
        notification();

        $(function () {
            getNotification();
        });
        function showBalance() {
            var balance;
            $.ajax({
                       url: "/api/com/currentBalance",
                       method: "post",
                       caches: false,
                       success: function (data) {
                           if (data.result) {
                               balance = data.msg;
                               $("#balance").html("余额:￥" + balance.toString()
                                       .replace(/(\d)(?=(\d{3})+\.)/g,
                                                function ($0, $1) {
                                                    return $1 + ",";
                                                }));
                               $("#showBalance").show();
                           } else {
                               alert(data.msg);
                           }
                       }
                   });
        }
        function hideBalance() {
            $("#showBalance").hide();
        }
        function showInformation() {
            layer.open({
                           title: false,
                           content: '/loginUserInfo',
                           area: ['600px', '350px'],
                           type: 2
                       })
        }
    </script>

</head>
<body>
<!-- <div id="rwc_hongbao" class="hbDiv" onclick="javascript:window.open('http://192.168.0.190:8081/gtimp/weixinhuodong.html','_blank');" -->
<!-- style="position: fixed; top: 80px; right: 10px; left: auto; display: block;"> -->
<!-- <div id="rwc_c_hongbao" class="close_xf" -->
<!-- style="position: absolute; display: block; top: 0px; left: 0px;"></div> -->
<!-- </div> -->
<div class="photoGallery"></div>
<table width="99%" border="0" cellspacing="0" cellpadding="0">
    <tr style="background-color: #0661a8">

        <td height="99" colspan="4" class="title"><img
                src="img/title_img2_1.jpg"
                style="position: absolute; left: 78px; top: 5px;"/>

            <div style="float: left; margin-left: 222px;">
    <span
            style="font-size: 35px; font-weight: bold; font-family: 微软雅黑; color: #fff">
    报关一线通平台 </span>
            </div>
            <div
                    style="float: right; padding-right: 30px; padding-top: 22px; color: #fff; font-size: 18px; font-family: '微软雅黑';">
                您好！<span
                    style="margin-right: 20px; font-weight: 50px; cursor: pointer; text-decoration: underline; color: #fff;"
                    onclick="showInformation()"
            <%--onclick="jw.dialog({iframe:'/loginUserInfo',title:'${sessionScope.session_user.name}',iframeFetchTitle:false,width:600,height:250,max:false});"--%>>${sessionScope.session_user.name}</span>
                <a style="color: #FFED22;" href="javascript:loginOut();">退出</a>
            </div>
            <div style="float: right; padding-right: 30px; padding-top: 22px;">
                <img src="img/title_money.png" onmouseover="showBalance()"
                     onmouseout="hideBalance()"/>
            </div>
            <div id="showBalance"
                 style="width: 190px; float: right;position:relative;display:none;">
                <img src="img/title_balance.png" style="width: 100%;height: 100%;"/>
                <span id="balance" style="position: absolute;bottom: 14px;color: #0066cc; font-size: 18px; text-align:center;
                font-family: '微软雅黑'; height: 24px; width: 100%;"/>
            </div>
        </td>
    </tr>
    <tr>
        <td height="100%" class="boder_bg"></td>
        <td align="left" valign="top" class="mid_left"
            style="vertical-align: top; width: 180px" id="frmTitle"
            name="frmTitle">
            <ul id="module" class="ztree"></ul>
        </td>
        <td class="boder_bg">
            <table border="0" cellPadding="0" cellSpacing="0" height="100%">
                <tr>
                    <td style="HEIGHT: 100%" onClick="switchSysBar()">
                        <!-- <p class="midcontrol"> -->
                        <p>
                            <span class="STYLE1" id="switchPoint" title="关闭/打开左栏">3</span>
                        </p>
                    </td>
                </tr>
            </table>
        </td>
        <td class="content" valign="top">
            <div id="main"></div>
        </td>
    </tr>
</table>


<div id="winpop">
    <div class="title">
        您有新的短消息！<span class="close" onclick="tips_pop()">×</span>
    </div>
    <div id="message" class="con" onclick="linkTo();"></div>
</div>

</body>
<script type="text/javascript"
        src="<s:url value="/views/yxtPc/assets/plugin/photoScroll/js/photoScroll.js"/>"></script>
<script type="text/javascript">
    var ver = 2.0;
    function linkTOv2(param) {
        if (param == "fundFlow") {
            tabObj
                    .addTab({
                                id: "fundFlow",
                                title: "资金流水",
                                // html : "<iframe id='fundFlow' src='fund/flow-main' width='100%' height='100%'frameborder='0'></iframe>",
                                html: "<iframe id='fundFlow' src='mrd/yxt-report-c.html' width='100%' height='100%'frameborder='0'></iframe>",
                                closable: true,
                                disabled: false
                            });
        }
        if (param == "fundAjustment") {
            tabObj
                    .addTab({
                                id: "fundAjustment",
                                title: "预付款记录",
                                html: "<iframe id='fundAjustment' src='fund/ajustment-main' width='100%' height='100%'frameborder='0'></iframe>",
                                closable: true,
                                disabled: false
                            });
        }
        if (param == "fundFlow_sup") {
            tabObj
                    .addTab({
                                id: "fundFlow_sup",
                                title: "资金流水",
                                html: "<iframe id='fundFlow_sup' src='fund/flow-supMain' width='100%' height='100%'frameborder='0'></iframe>",
                                closable: true,
                                disabled: false
                            });
        }
    }
    setTimeout(function () {
        $.get("fund/ajustment-sysjob", function () {
        });
    }, 2000)
    $(document).ready(function () {
        //请求是否存在系统更新
        $.ajax({
                   url: "notice/showNewNotice",
                   cache: false,
                   type: "post",
                   dataType: "json",
                   success: function (data) {
                       if (data.result == true) {
                           var pictureList = data.data.pictureList;
                           $(".photoGallery").photoScroll({
                                                              needRequest: false,//不需要请求
                                                              dataSource: pictureList,//公告图片数据
                                                              needRemark: true,//是否需要标记
                                                              needRemarkIds: data.data.noticeIds//标记对应公告的id

                                                          });

                       }
                   }
               });

    });
</script>
</html>

